import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class TestSocketServer {

    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(8050);
            SiLabsValuesReader siLabsValuesReader = new SiLabsValuesReader();
            System.out.println("Server started");
            while (true) {
                Socket socket = serverSocket.accept();
                System.out.println(socket.getInetAddress().getHostName() + " connected");
                ServerThread thread = new ServerThread(socket, siLabsValuesReader);
                thread.start();
            }
        } catch (IOException e) {
            System.err.println(e);
        }
    }
}
